'''
Created on Sep 22, 2012

@author: kingsfield
'''
import csv
import time

train_file = '/home/kingsfield/Desktop/BestBuyPc/weak_predict/0'

def readfile(f):
    #with open(file) as infile:
    infile = open(f)
    reader = csv.reader(infile, delimiter=",")
    reader.next() # burn the header
    return reader

if __name__ == '__main__':
    st = time.time()
    for i in xrange(20):
#        reader = readfile(train_file)
#        for (user, sku, category, raw_query, click_time, ___query_time) in reader:
#            pass
        with open(train_file) as fr:
            while True:
                line = fr.readline()
                if not line:
                    break
                user, sku, category, raw_query, click_time, ___query_time = line.split(',')
    ed = time.time()
    print 'read cost=%f' % (ed - st)
    print 'done'
